package Manage;

import java.util.Random;

public class SystemHealthMonitor {
    // 模拟检查系统健康
    public void checkSystemHealth() {
        Random random = new Random();
        int cpuUsage = random.nextInt(101);
        int memoryUsage = random.nextInt(101);

        System.out.println("CPU 使用率: " + cpuUsage + "%");
        System.out.println("内存使用率: " + memoryUsage + "%");

        if (cpuUsage > 80 || memoryUsage > 80) {
            System.out.println("警告: 系统资源使用率过高！");
        } else {
            System.out.println("系统运行正常");
        }
    }
}
